UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'hAP8BMAOyQXwcXrNPbz91EQICGSsVxtQKbFS/tR1QQI='
WHERE
key_id = 'bf22b409d28d79bcfa00c3337b5ca2faccda3d52e8274f853dabffa29d7e4636'
AND (
token = 'hAP8BMAOyQXwcXrNPbz91EQICGSsVxtQKbFS/tR1QQI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)