UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'EH4pWqTVPBkBULK6kpvW9uLXyMWU7UtWs40IJ8IB078='
WHERE
key_id = '420d3b57cfa2c6b5ebd811abb8a54e993a482b7d03a465fe5e7a3e4efd3e8a04'
AND (
token = 'EH4pWqTVPBkBULK6kpvW9uLXyMWU7UtWs40IJ8IB078='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)