UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'T+AXG6pitAy42WyZSUyFD/drO+xHOnB/MyQcc9jg99g='
WHERE
key_id = '61ce6a290abaf78ed70996c711e47c112c9c38587f9fcaa6d9d0c47a5698ca4d'
AND (
token = 'T+AXG6pitAy42WyZSUyFD/drO+xHOnB/MyQcc9jg99g='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)