UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '/HQLycyeTw/yphJSMQINbDAWGxdCDrp71+3TuakIcyk=' 
WHERE 
  key_id = '834c2797af83a9cd37eb6a8bf4e0e4c2668be381bd342cec61240cda5ce68609' 
  AND (
    token = '/HQLycyeTw/yphJSMQINbDAWGxdCDrp71+3TuakIcyk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00076