UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'uC7g1DyUiYA8yZ0LZN0IG4qS5HcCtzKmhosXP4XZHzI='
WHERE
key_id = '8411209588ae98058f39e91d39fadd5277656d5057ff7e8b5f8faef9493dd85c'
AND (
token = 'uC7g1DyUiYA8yZ0LZN0IG4qS5HcCtzKmhosXP4XZHzI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)