UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'i6ymc2pazwkwiGilV5/Nwrdq72/eVa5ZkLOtnj6KDEk=' 
WHERE 
  key_id = '68796a2b9093cbd789f272cc28fc9bc8d851c61e582981621d9df30730627fe4' 
  AND (
    token = 'i6ymc2pazwkwiGilV5/Nwrdq72/eVa5ZkLOtnj6KDEk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032