UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '5e1O6WpWcj2wLAsol/JpHCW13KNjououWxuXpkvm8Uo=' 
WHERE 
  key_id = 'c575d6ceb884b5e82f5db544c1cf9b3464159d06c4d5b13c63db8e32e41e2e59' 
  AND (
    token = '5e1O6WpWcj2wLAsol/JpHCW13KNjououWxuXpkvm8Uo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030