UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'W1d/W1zztLIqqPFAq2apGZ/MLb9GO2b1v4nuCy2Ulks='
WHERE
key_id = '8d07907961382f79c4684fe34a0b5c0d75297775e55bf4a03a2bfb26043044d7'
AND (
token = 'W1d/W1zztLIqqPFAq2apGZ/MLb9GO2b1v4nuCy2Ulks='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)