UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '0X/WAr/aiZWgc0XlMRjtFABousJRrNrtEIl0C2uP37U=' 
WHERE 
  key_id = 'a0a36a13171304d2fee343d6874971514f92bf96ae678474d2a03d6bd642e803' 
  AND (
    token = '0X/WAr/aiZWgc0XlMRjtFABousJRrNrtEIl0C2uP37U=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00039