UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'S+CwTUjp3sstco0B1A6o3dYsZ+qLZXmbr7YqC6CcVxg=' 
WHERE 
  key_id = '06c58aa5126b57f1b26914d0f8d2ea4ce7592ccc26e0c4a832bcf4a054d2c5fb' 
  AND (
    token = 'S+CwTUjp3sstco0B1A6o3dYsZ+qLZXmbr7YqC6CcVxg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00044