UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'BCf/nlP0JdJ9Yqox5fj59acp0Up3Fk/r0xxWjrT1UiE='
WHERE
key_id = '62ef8712236fd88539fdd1f82b61c4c8ea4dd4bcf85d5b0c3176fee9d113f598'
AND (
token = 'BCf/nlP0JdJ9Yqox5fj59acp0Up3Fk/r0xxWjrT1UiE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)