UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Z6qYrcBUlD/vr12MFBsb5K1B8t7MrHVuQJ/HWrzw1ME=' 
WHERE 
  key_id = 'ceb32ad0f671bdbddc3b6e80ab5073e8c93512b60d6f1ed8a3a453df1a5eff28' 
  AND (
    token = 'Z6qYrcBUlD/vr12MFBsb5K1B8t7MrHVuQJ/HWrzw1ME=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034