UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'zyx+bypI2qUQjSCberhBE4qu9zXleQhmkpw8Iz4rtJ4=' 
WHERE 
  key_id = '7a9ff15a4811c592fa203fa49fd91f1c914f844c79c0c79c15bb21fce543bead' 
  AND (
    token = 'zyx+bypI2qUQjSCberhBE4qu9zXleQhmkpw8Iz4rtJ4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028