UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'nY/nfyQXj+A90uoJMFkfEopkYBP0OQyF/THkijbS2y4='
WHERE
key_id = 'f1e88b4c0670a0ea978dd95370879629c9a2f0f2a55a8f049195353e23c65584'
AND (
token = 'nY/nfyQXj+A90uoJMFkfEopkYBP0OQyF/THkijbS2y4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)