UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'BdklhU6acg+eBUjwKSy+iapDmqeyMZ142HHFjL0mD88='
WHERE
key_id = 'e2fecbd643c1f4867394ae4c6a9636ead1ce4c6e1f4e32ab4fd8b993fa4dae44'
AND (
token = 'BdklhU6acg+eBUjwKSy+iapDmqeyMZ142HHFjL0mD88='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)