UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '7LelwAdqd1+ITOsozTWHdH9mYNUYzUVUQrgGf3XJ0HA='
WHERE
key_id = '63188c7d76c84e5482e13a5f5d68012d816c4aa0077827ae1536463802bd791d'
AND (
token = '7LelwAdqd1+ITOsozTWHdH9mYNUYzUVUQrgGf3XJ0HA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)