UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'TNTwU+NX+KhnwIyCh8MM7ZHe51OmIPRgZeWE7g9IY0M='
WHERE
key_id = 'e02b70aac8d0b3fcbb4d11024731219b1fd80e3615ce1a6ca6e0e015c7814003'
AND (
token = 'TNTwU+NX+KhnwIyCh8MM7ZHe51OmIPRgZeWE7g9IY0M='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)