UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'w8oMmmm9Yeokfs9DXWjGoQeHzu0gaoiVvT1jTJV7PGM=' 
WHERE 
  key_id = 'e93d314c3e2bb47bcb18b053fd3537445db0dadca1e77968e56eb80dcaf0bf35' 
  AND (
    token = 'w8oMmmm9Yeokfs9DXWjGoQeHzu0gaoiVvT1jTJV7PGM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033