UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'BOM4ohfhG7aiTQ21p1T3PEipON3YnQHVO3rIYuWlafU='
WHERE
key_id = 'ac83512013e41a04b46499e6dfdfa5973e02930f34ff007b79b7d632e182404b'
AND (
token = 'BOM4ohfhG7aiTQ21p1T3PEipON3YnQHVO3rIYuWlafU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)