UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ugu/gZmQX+cr3QKq16Hy34FvdjDAF+Ha9nz2mjAHTNA=' 
WHERE 
  key_id = '3e70dfd4561bff0f7118b1a5fc133e30276ae87f61cb47263fc4b914a82eafe2' 
  AND (
    token = 'ugu/gZmQX+cr3QKq16Hy34FvdjDAF+Ha9nz2mjAHTNA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031