UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'dUAKisNjOa1kbZ22+72VOQb/HDTMaXwI35IJaGXNY24='
WHERE
key_id = 'd4905cdaf0d832c51f2351ecc12174d4e97589fc51fec75f358b7e3aa9df8ce4'
AND (
token = 'dUAKisNjOa1kbZ22+72VOQb/HDTMaXwI35IJaGXNY24='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)