UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '5M6VbFSekEZpPCRtEuFnDOfD6BnjzEKazi83D60zYl0='
WHERE
key_id = '6d01c48dcb89bc31cc5a223e31afae70a72c56b7aa8691a9dd128ed2d9a56a1d'
AND (
token = '5M6VbFSekEZpPCRtEuFnDOfD6BnjzEKazi83D60zYl0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)