UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'dVrl4EmDOIXb71M81pIl+mT/ecYqIbJrmmFr3d/Z01g='
WHERE
key_id = '33c83cd1bc0cbd2d6486ec8fbd11373ce33db7b36baf47ac2f0ccd56d6a3eb59'
AND (
token = 'dVrl4EmDOIXb71M81pIl+mT/ecYqIbJrmmFr3d/Z01g='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)