UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'aL7TTsw58c+b94L6O5aI0ZyfCMs9V2m9cHD9BNWqYKo='
WHERE
key_id = '2dc1be0e0b4c2a7445936ddcb8b6ac42174e3c74513a191bc53a111601456da8'
AND (
token = 'aL7TTsw58c+b94L6O5aI0ZyfCMs9V2m9cHD9BNWqYKo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)