UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '+UvHhYPCM2qQLiudfp+u1eIpB8BQDZssBsR6z+y7tH8='
WHERE
key_id = 'ea32aeb29edd1f9947f767cb4daa262449ff6cf4f9585a59324e892233bf1d02'
AND (
token = '+UvHhYPCM2qQLiudfp+u1eIpB8BQDZssBsR6z+y7tH8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)