UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '2OOlsdsenb9i2/tA51hKknCoM981Djqut/heHSkDM5Q=' 
WHERE 
  key_id = 'ea16f3d806f141bd146001601538eef60a124b25d32f74b1de79c59d45cd9b3f' 
  AND (
    token = '2OOlsdsenb9i2/tA51hKknCoM981Djqut/heHSkDM5Q=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00040