UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'QI5TahItZEIQutRotfieJZ6ZiUibiYZYADgvJT9YC24='
WHERE
key_id = 'f43fcfc7183a68e74ee21aed80ee2055e0403fa35ed2b5a5e98643db692f565d'
AND (
token = 'QI5TahItZEIQutRotfieJZ6ZiUibiYZYADgvJT9YC24='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)