UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '1QL9BIMdfpaLGs0KPR3TjAAs57ug0UWfQIUssjgF9PA=' 
WHERE 
  key_id = '3e28fea20558c3a6bea02dff2b1ff9d14ced3d90ce24857084b2c4da58b7349d' 
  AND (
    token = '1QL9BIMdfpaLGs0KPR3TjAAs57ug0UWfQIUssjgF9PA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029