UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'KQoJN2Oc18IleOMsxe1T4DTaUsPCwgMQa25y8P6vGcE=' 
WHERE 
  key_id = 'cd82d8e256e97bfc8ee947860246eaa63f6474db1fe007ae4e8b80b2ce1077d6' 
  AND (
    token = 'KQoJN2Oc18IleOMsxe1T4DTaUsPCwgMQa25y8P6vGcE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00043