UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'RDpa/4o6JN5EZo5Yqht51S5umSk5u8ruyfmmMQgs5zo=' 
WHERE 
  key_id = 'eefe25bde290072997a3c76174f71fbfecb79444b3eecca7d6399bc0a55d69eb' 
  AND (
    token = 'RDpa/4o6JN5EZo5Yqht51S5umSk5u8ruyfmmMQgs5zo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031