UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Im33MA/fAqRudGV6v6WNFF6pCjnOpP0bfl/ZjBWGtB0='
WHERE
key_id = '27bb21bff9fce047f71be22fa1ef436a140fb123e361fe0dd7be6b00b050cabe'
AND (
token = 'Im33MA/fAqRudGV6v6WNFF6pCjnOpP0bfl/ZjBWGtB0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)