UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '6xzS1n4LmunB//vnTYa31UbCEAHBYUAqj1JgBHkmN04='
WHERE
key_id = '9d05bde73f2cb5c655d24f85e8a664cfd08b6b9e2574e8a7515aff98a2d3f775'
AND (
token = '6xzS1n4LmunB//vnTYa31UbCEAHBYUAqj1JgBHkmN04='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)