UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'a/QAOSfM9qVJ3u89UgA04R0dtRB3BprJBwDvHkOVlHs=' 
WHERE 
  key_id = 'cee4cc1f36e10fc2c6ba9cf31f59b18ab116cb88848c11fb1442aadccb49b93c' 
  AND (
    token = 'a/QAOSfM9qVJ3u89UgA04R0dtRB3BprJBwDvHkOVlHs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00042