UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'L52R8X4mbf9jaOBsHVf5Vr41HcTDku2daz+gzsck6i0=' 
WHERE 
  key_id = 'f9821b1b1ec3c31fb75edfe8a7b5e52831a15bcdb6a3c5365e5dd76db6d5f1bb' 
  AND (
    token = 'L52R8X4mbf9jaOBsHVf5Vr41HcTDku2daz+gzsck6i0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036