UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'WsSnro8Lef/NL0TUXfMqWa8tOV+cboiwR+gr21LFfLc='
WHERE
key_id = 'c108fc3de2878b39c2477bd3f4dd0a768a60563361ebee5a6df11e756352ae2f'
AND (
token = 'WsSnro8Lef/NL0TUXfMqWa8tOV+cboiwR+gr21LFfLc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)